TBinaryTree< T > Class Template Reference
[Template Containers]

TBinaryTree is a rooted binary tree. More...

#include <tbinarytree.h>

Inheritance diagram for TBinaryTree< T >:
Inheritance graph
[legend]

Public Member Functions

 TBinaryTree ()
 Default constructor.
 TBinaryTree (const TBinaryTree< T > &)
 Copy constructor.
 TBinaryTree (const TContainer< T > &)
 Construct from container.
 ~TBinaryTree ()
 Tree destructor.
virtual TContainer< T > * newInstance () const
TBinaryTree< T > & operator= (const TBinaryTree< T > &)
 Assignment.
virtual bool add (const T &)
 Add item to tree.
virtual bool remove (const T &)
 Remove item from tree.
virtual bool remove (const TIterator< T > &)
 Remove iterator item.
virtual bool removeAt (int32 index)
 Remove item at index.
virtual void removeAll ()
 Remove all items.
const T & root () const
 Return root tree item.
void balance ()
 Balance the tree.
virtual T & lookup (const T &) const
 Find equal item in tree.
virtual bool contains (const T &) const
 Is equal item in tree?
virtual int32 occurrences (const T &) const
 Count occurrences of item.
TIterator< T > * newIterator () const
 Get tree iterator.

Detailed Description

template<class T>
class Steinberg::TBinaryTree< T >

TBinaryTree is a rooted binary tree.

From wikipedia: A binary tree is a connected acyclic graph such that the degree of each vertex is no more than 3. It can be shown that in any binary tree, there are exactly two more nodes of degree one than there are of degree three, but there can be any number of nodes of degree two. A rooted binary tree is such a graph that has one of its vertices of degree no more than 2 singled out as the root.


Constructor & Destructor Documentation

TBinaryTree (  ) 

Default constructor.

TBinaryTree ( const TBinaryTree< T > &   ) 

Copy constructor.

TBinaryTree ( const TContainer< T > &   ) 

Construct from container.

~TBinaryTree (  ) 

Tree destructor.


Member Function Documentation

virtual TContainer<T>* newInstance (  )  const [virtual]

Implements TContainer< T >.

TBinaryTree<T>& operator= ( const TBinaryTree< T > &   ) 

Assignment.

virtual bool add ( const T &   )  [virtual]

Add item to tree.

Implements TContainer< T >.

virtual bool remove ( const T &   )  [virtual]

Remove item from tree.

Implements TContainer< T >.

virtual bool remove ( const TIterator< T > &   )  [virtual]

Remove iterator item.

Implements TContainer< T >.

virtual bool removeAt ( int32  index  )  [virtual]

Remove item at index.

Implements TContainer< T >.

virtual void removeAll (  )  [virtual]

Remove all items.

Implements TContainer< T >.

const T& root (  )  const

Return root tree item.

void balance (  ) 

Balance the tree.

virtual T& lookup ( const T &   )  const [virtual]

Find equal item in tree.

Reimplemented from TContainer< T >.

virtual bool contains ( const T &   )  const [virtual]

Is equal item in tree?

Reimplemented from TContainer< T >.

virtual int32 occurrences ( const T &   )  const [virtual]

Count occurrences of item.

Reimplemented from TContainer< T >.

TIterator<T>* newIterator (  )  const [virtual]

Get tree iterator.

Implements TContainer< T >.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Empty

Copyright ©2013 Steinberg Media Technologies GmbH. All Rights Reserved.